<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>单行文字垂直居中</title>
    <style>

        /* 行高与高度一致 ，文字就居中 */
        div {
            width: 200px;
            height: 50px;
            background-color: orange;

            line-height: 70px;
        }
    </style>
</head>
<body>
    <div>我要居中</div>
</body>
</html>